//
//  HJGroupMemberModel.m
//  KaiChat
//
//  Created by lx on 2023/11/2.
//

#import "HJGroupMemberModel.h"

@implementation HJGroupMemberModel


MJLogAllIvars

+ (NSArray *)bg_uniqueKeys {
    return @[@"userId"];
}

+ (NSArray *)bg_ignoreKeys {
    return @[@"isSelect"];
}

- (NSString *)bg_tableName {
    return [NSString stringWithFormat:@"%@_%@_%@", NSStringFromClass(self.class), HJUserInfo.userId, _groupId];
}

+ (NSString *)bg_tableNameWithGroupId:(NSString *)groupId {
    return [NSString stringWithFormat:@"%@_%@_%@", NSStringFromClass(self.class), HJUserInfo.userId, groupId];
}

+ (HJGroupMemberModel *)modelWithDict:(NSDictionary *)dict {
    HJGroupMemberModel *model = [[HJGroupMemberModel alloc] init];
    model.avatar = dict[@"user_avatar"];
    model.userId = toString(dict[@"user_id"]);
    model.nickname = dict[@"user_nickname"];
    model.role = [dict[@"role"] intValue];
    return model;
}


@end
